<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>查询水果</title>
    <script>
        var fruit = prompt('请输入您要查询的水果：');
        switch (fruit) {
            case '榴莲':
                alert('5元/斤');
                break;

            case '苹果':
                alert('10元/斤');
                break;

            default:
                alert('没有此水果！')

        }
    </script>
</head>

<body>

</body>

</html>